using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.Messages.Entity
{
    [Table("VDeviceStatus", null, "Wicresoft.Messages.ConnectionString")]
    public class VDeviceStatus : ViewInfo
    {
        #region SQL column name consts
        public const string SQLCOL_DEVICEID = "DeviceID";
        public const string SQLCOL_DEVICENAME = "DeviceName";
        public const string SQLCOL_DEVICEDISPLAYNAME = "DeviceDisplayName";
        public const string SQLCOL_ASSEMBLYNAME = "AssemblyName";
        public const string SQLCOL_INCOMINGCLASSNAME = "IncomingClassName";
        public const string SQLCOL_OUTGOINGCLASSNAME = "OutgoingClassName";
        public const string SQLCOL_USEPOOL = "UsePool";
        public const string SQLCOL_CONTACTCOLUMN = "ContactColumn";
        public const string SQLCOL_DESCRIPTION = "Description";
        public const string SQLCOL_OUTGOINGSTATUS = "OutgoingStatus";
        public const string SQLCOL_INCOMINGSTATUS = "IncomingStatus";
        #endregion


        #region Contructors
        /// <summary>
        /// Construct empty entity
        /// </summary>
        public VDeviceStatus() { }

        #endregion

        public override void Init(DataRow row)
        {
            DeviceID = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_DEVICEID]);
            DeviceName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEVICENAME]);
            DeviceDisplayName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEVICEDISPLAYNAME]);
            AssemblyName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_ASSEMBLYNAME]);
            IncomingClassName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_INCOMINGCLASSNAME]);
            OutgoingClassName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_OUTGOINGCLASSNAME]);
            UsePool = (bool)ObjectType.BooleanTypeHelper.Read(row[SQLCOL_USEPOOL]);
            ContactColumn = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_CONTACTCOLUMN]);
            Description = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DESCRIPTION]);
            OutgoingStatus = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_OUTGOINGSTATUS]);
            IncomingStatus = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_INCOMINGSTATUS]);
        }

        #region Properties
        #region Property <int> DeviceID
        [Property("DeviceID", 4, SqlDbType.Int, false, false)]
        public int DeviceID
        {
            get { return _DeviceID; }
            set { _DeviceID = value; }
        }
        private int _DeviceID = int.MinValue;
        #endregion

        #region Property <string> DeviceName
        [Property("DeviceName", 100, SqlDbType.NVarChar, false, false)]
        public string DeviceName
        {
            get { return _DeviceName; }
            set { _DeviceName = value; }
        }
        private string _DeviceName = null;
        #endregion

        #region Property <string> DeviceDisplayName
        [Property("DeviceDisplayName", 100, SqlDbType.NVarChar, false, false)]
        public string DeviceDisplayName
        {
            get { return _DeviceDisplayName; }
            set { _DeviceDisplayName = value; }
        }
        private string _DeviceDisplayName = null;
        #endregion

        #region Property <string> AssemblyName
        [Property("AssemblyName", 400, SqlDbType.NVarChar, false, false)]
        public string AssemblyName
        {
            get { return _AssemblyName; }
            set { _AssemblyName = value; }
        }
        private string _AssemblyName = null;
        #endregion

        #region Property <string> IncomingClassName
        [Property("IncomingClassName", 400, SqlDbType.NVarChar, false, false)]
        public string IncomingClassName
        {
            get { return _IncomingClassName; }
            set { _IncomingClassName = value; }
        }
        private string _IncomingClassName = null;
        #endregion

        #region Property <string> OutgoingClassName
        [Property("OutgoingClassName", 400, SqlDbType.NVarChar, false, false)]
        public string OutgoingClassName
        {
            get { return _OutgoingClassName; }
            set { _OutgoingClassName = value; }
        }
        private string _OutgoingClassName = null;
        #endregion

        #region Property <bool> UsePool
        [Property("UsePool", 1, SqlDbType.Bit, false, false)]
        public bool UsePool
        {
            get { return _UsePool; }
            set { _UsePool = value; }
        }
        private bool _UsePool = false;
        #endregion

        #region Property <string> ContactColumn
        [Property("ContactColumn", 200, SqlDbType.NVarChar, false, false)]
        public string ContactColumn
        {
            get { return _ContactColumn; }
            set { _ContactColumn = value; }
        }
        private string _ContactColumn = null;
        #endregion

        #region Property <string> Description
        [Property("Description", 2147483646, SqlDbType.NText, false, false)]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        private string _Description = null;
        #endregion

        #region Property <int> OutgoingStatus
        [Property("OutgoingStatus", 4, SqlDbType.Int, false, false)]
        public int OutgoingStatus
        {
            get { return _OutgoingStatus; }
            set { _OutgoingStatus = value; }
        }
        private int _OutgoingStatus = int.MinValue;
        #endregion

        #region Property <int> IncomingStatus
        [Property("IncomingStatus", 4, SqlDbType.Int, false, false)]
        public int IncomingStatus
        {
            get { return _IncomingStatus; }
            set { _IncomingStatus = value; }
        }
        private int _IncomingStatus = int.MinValue;
        #endregion
        #endregion
    }
}
